import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [  
  {
    path: '/test',
    name: 'test',
    component: () => import('../views/lotteryDrawModel/test.vue')
  },
  // 现金红包
  {
    path: "/BroughtGoldIndex",
    name: "BroughtGoldIndex",
    component: resolve => require(['@/views/activity/BroughtGold/BroughtGoldIndex'],resolve),
    redirect: '/BroughtGoldIndex/BroughtGold',
    children: [
      {
        path: 'BroughtGold',
        name: 'BroughtGold',
        component: resolve => require(['@/views/activity/BroughtGold/BroughtGold'],resolve),
      },
      // 累计已抢
        {
            path: 'RedEnvelope',
            name: 'RedEnvelope',
            component: resolve => require(['@/views/activity/BroughtGold/RedEnvelope'],resolve),
        },
        //红包详情
        {
          path: 'Details',
          name: 'Details',
          component: resolve => require(['@/views/activity/BroughtGold/Details'],resolve),
      },
    ]
  },
    
  // 打卡挑战
  {
    path: '/ClockInIndex',
    name: 'ClockInIndex',
    component: resolve => require(['@/views/activity/ClockIn/ClockInIndex'],resolve),
    redirect: '/ClockInIndex/ClockIn',
    children: [
      {
        path: '/ClockInIndex/ClockIn',
        name: 'ClockIn',
        component: resolve => require(['@/views/activity/ClockIn/ClockIn'],resolve),
      },
      {
        path: '/ClockInIndex/MyIncome',
        name: 'MyIncome',
        component: resolve => require(['@/views/activity/ClockIn/MyIncome'],resolve),
      }
    ]
  },
  //盲盒抽奖
  {
    path: '/BlindBoxIndex',
    name: 'BlindBoxIndex',
    component: resolve => require(['@/views/activity/BlindBox/BlindBoxIndex'],resolve),
    redirect: '/BlindBoxIndex/BlindBox',
    children: [
      {
        path: '/BlindBoxIndex/BlindBox',
        name: 'BlindBox',
        component: resolve => require(['@/views/activity/BlindBox/BlindBox'],resolve),
      }, 
    ]
  },
  //话费秒杀
  {
    path: '/PhoneKillIndex',
    name: 'PhoneKillIndex',
    component: resolve => require(['@/views/activity/PhoneKill/PhoneKillIndex'],resolve),
    redirect: '/PhoneKillIndex/PhoneKill',
    children: [
      {
        path: '/PhoneKillIndex/PhoneKill',
        name: 'PhoneKill',
        component: resolve => require(['@/views/activity/PhoneKill/PhoneKill'],resolve),
      }, 
    ]
  },
  //天天砸金蛋
  {
    path: '/HitEggsIndex',
    name: 'HitEggsIndex',
    component: resolve => require(['@/views/activity/HitEggs/HitEggsIndex'],resolve),
    redirect: '/HitEggsIndex/HitEggs',
    children: [
      {
        path: '/HitEggsIndex/HitEggs',
        name: 'HitEggs',
        component: resolve => require(['@/views/activity/HitEggs/HitEggs'],resolve),
      }, 
    ]
  },
  
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
